var express = require('express');
const multer = require('multer')

const upload = multer({ dest: './public/uploads/' }).single('file')
const moreUpload = multer({ dest: './public/moreUploads/' }).array('files')
var router = express.Router();
var { sendRand, login, userInfosReg, loginPhoneorUnameAndPwd, userImgUpload, userImgsUpload, postUpload } = require('../controller/userController');
const db = require('../util/db');

router.post('/getRand', sendRand)
router.post('/login', login)
router.post('/userInfosReg', userInfosReg)
router.post('/loginPhoneorUnameAndPwd', loginPhoneorUnameAndPwd)
router.post('/userImgUpload', upload, userImgUpload)
router.post('/userImgsUpload', moreUpload, userImgsUpload)
router.post('/postUpload', postUpload)

module.exports = router;
